<template>
	<view>
		<Login v-if="show==='login'" />
		<Index v-if="show==='index'" />
	</view>
</template>

<script>
	import Login from '@/pages/login/index.vue'
	import Index from '@/pages/index/index.vue'
	
	export default {
		components: {
			Login,
			Index
		},
		data() {
			return {
				show: ''
			}
		},
		onShow() {
			uni.hideHomeButton()
		},
		onLoad() {
			if (uni.getStorageSync('openid')) {
				this.show = 'index'
				  wx.setNavigationBarTitle({
				        title:"AI智能对话"
				    })
			} else {
				this.show = 'login'
				  wx.setNavigationBarTitle({
				        title:"登录"
				    })
			}
		},
		methods:{
			
		}
	}
</script>

<style>
</style>
